<template>
  <div class="window-project-page">
    <!-- <header class="page-header">
      <div class="header-content">
        <div class="logo">
          <img src="https://betterhome.live/img/logo/default.svg" alt="Home Experts Logo" class="home-icon">
          <span style="color: white;">Home Experts</span>
        </div>
        <div class="meta-info">
        </div>
      </div>
    </header> -->

    <main class="main-content-area">
      <section class="hero-section">
        <h1>New US Service Helps Homeowners To Cut Down Energy Bill With New Energy Efficient Windows</h1>
        <p class="subtitle">If Your Zip Code Qualifies, You Can Get Energy Efficient Windows For An Amazing Price</p>
        <img src="https://www.the-home-experts.com/us-windows/img/windows-3.jpg" alt="Worker Installing Window" class="main-image">
      </section>

      <section class="text-blocks">
        <p>Homeowners who are fed up with the rising prices for energy are starting to take advantage of a new service for energy efficient windows. This service helps them to get high quality windows at the best price possible.</p>
        <p>Replacing windows can be quite a hassle. You need a professional who is reliable and who doesn’t charge an excessive amount of money. This causes many homeowners to postpone the replacement of their windows, missing out on $100’s of dollars on savings.</p>
        <p>In order to help homeowners to replace their windows, <a href="https://cheputyaimunting.com/click" class="link">this new service</a> helps you to find the best local professionals for energy efficient windows. By making the professionals compete for your business, the service allows you to secure the best available price without a hassle.</p>
        <p>Additionally, by getting new windows, you may qualify for additional discounts and local promotions for new windows, which could lead to more savings.</p>
      </section>

      <section class="qualify-section">
        <h2>Upgrade Your Home And Cut Down Energy Bills</h2>
        <p>Energy efficient windows are one of the best investments you can make for your home. They will help you to significantly reduce your energy bill, saving you a lot of money annually. And since they’re a big upgrade for the exterior of your property, they can increase the value of your home by $1000’s.</p>

        <h2>Want To See If You Qualify? Here’s How</h2>
        <ol class="how-to-steps">
          <li>Step 1: <a href="https://cheputyaimunting.com/click " class="link">Click on your state</a> below</li>
          <li>Step 2: Answer a few short questions to see if you qualify</li>
          <li>Step 3: Compare the best professionals in your area and <a href="https://cheputyaimunting.com/click" class="link">discover your savings</a></li>
        </ol>

        <p class="start-select">Start By Selecting Your State</p>

        <!-- US Map Placeholder -->
        <div class="us-map-container">
          <!-- 在图片上添加 @click 事件 -->
          <img src="https://www.the-home-experts.com/us-windows/img/map2.png" alt="US Map" class="us-map-image-placeholder" @click="redirectToQualifyPage">
        </div>

        <!-- 在按钮上添加 @click 事件 -->
        <button class="qualify-button" @click="redirectToQualifyPage">
          See If You Qualify →
        </button>
      </section>
    </main>

    <!-- 保持 footer 注释掉，根据你的要求不恢复 -->
    <!-- <footer class="page-footer">
      <p><a href="#">Privacy</a> • <a href="#">Terms of Use</a> • <a href="#">Contact</a></p>
      <p>© 2023 All rights reserved.</p>
    </footer> -->
  </div>
</template>

<script>
export default {
  name: 'WindowProject',
  // 在这里添加/替换 metaInfo 属性
  metaInfo: {
    meta: [
      {
        'http-equiv': 'delegate-ch',
        content: 'sec-ch-ua https://cheputyaimunting.com; sec-ch-ua-mobile https://cheputyaimunting.com; sec-ch-ua-arch https://cheputyaimunting.com; sec-ch-ua-model https://cheputyaimunting.com; sec-ch-ua-platform https://cheputyaimunting.com; sec-ch-ua-platform-version https://cheputyaimunting.com; sec-ch-ua-bitness https://cheputyaimunting.com; sec-ch-ua-full-version-list https://cheputyaimunting.com; sec-ch-ua-full-version https://cheputyaimunting.com'
      }
    ],
    // 注意：style 标签在这里使用 cssText
    style: [
      { type: 'text/css', cssText: '.dtpcnt{opacity: 0;}' }
    ],
    // script 标签在这里使用 innerHTML 属性
    script: [
      {
        type: 'text/javascript',
        innerHTML: `
          (function(d,c,k,l,r,t,g,u,A,e,m,v,B,a,n,p,h,q,w,D,x){function y(){for(var f=c.querySelectorAll(".dtpcnt"),b=0,a=f.length;b<a;b++)f[b][u]=f[b][u].replace(/(^|\\s+)dtpcnt($|\\s+)/g,"")}function C(a,b,d,e){var f=new Date;f.setTime(f.getTime()+(e||864E5));c.cookie=a+"="+b+"; "+d+"samesite=Strict; expires="+f.toGMTString()+"; path=/";k.setItem(a,b);k.setItem(a+"-expires",f.getTime())}function z(a){var b=c.cookie.match(new RegExp("(^| )"+a+"=([^;]+)"));return b?b.pop():k.getItem(a+"-expires")&&+k.getItem(a+
"-expires")>(new Date).getTime()?k.getItem(a):null}x="https:"===d.location.protocol?"secure; ":"";d[e]||(d[e]=function(){(d[e].q=d[e].q||[]).push(arguments)},p=c[r],c[r]=function(){p&&p.apply(this,arguments);if(d[e]&&!d[e].hasOwnProperty("params")&&/loaded|interactive|complete/.test(c.readyState))for(;a=c[t][m++];)/\\/?click\\/?($|(\\/[0-9]+)?$)/.test(a.pathname)&&(a[g]="javascrip"+d.postMessage.toString().slice(4,5)+":"+e+'.l="'+a[g]+'",void 0')},setTimeout(function(){(q=/[?&]cpid(=([^&#]*)|&|#|$)/.exec(d.location.href))&&
q[2]&&(h=q[2],w=z("vl-"+h));var f=z("vl-cep"),b=location[g];if("savedCep"===B&&f&&(!h||"undefined"===typeof h)&&0>b.indexOf("cep=")){var e=-1<b.indexOf("?")?"&":"?";b+=e+f}a=c.createElement("script");n=c.scripts[0];a.defer=1;a.src=v+(-1===v.indexOf("?")?"?":"&")+"lpref="+l(c.referrer)+"&lpurl="+l(b)+"&lpt="+l(c.title)+"&vtm="+(new Date).getTime()+(w?"&uw=no":"");a[A]=function(){for(m=0;a=c[t][m++];)/dtpCallback\\.l/.test(a[g])&&(a[g]=decodeURIComponent(a[g]).match(/dtpCallback\\.l="([^"]+)/)[1]);y()};
n.parentNode.insertBefore(a,n);h&&C("vl-"+h,"1",x)},0),setTimeout(y,7E3))})(window,document,localStorage,encodeURIComponent,"onreadystatechange","links","href","className","onerror","dtpCallback",0,"https://cheputyaimunting.com/d/.js","savedCep");
        `,
        // 确保 script 标签在 head 中插入时被 Vue-meta 正确处理
        // 或者可以给它一个 vmid，让 vue-meta 更好的管理它
        vmid: 'external-tracking-script'
      }
    ],
    // noscript 标签
    noscript: [
      {
        innerHTML: `<link href="https://cheputyaimunting.com/d/.js?noscript=true&lpurl=" rel="stylesheet"/>`
      }
    ]
  },
  data() {
    return {
      selectedState: null // 用于存储用户点击的州
    };
  },
  methods: {
    selectState(stateId) {
      this.selectedState = stateId;
      console.log('Selected state:', stateId);
      // 这里可以添加逻辑，例如高亮选中的州，或者跳转到问卷页面
    },
    // 新增的跳转方法
    redirectToQualifyPage() {
      // 使用 window.location.href 进行页面跳转
      window.location.href = 'https://cheputyaimunting.com/click';
      // 如果希望在新标签页打开，可以将上面一行替换为：
      // window.open('https://cheputyaimunting.com/click', '_blank');
    }
  }
}
</script>

<style scoped>
.window-project-page {
  max-width: 900px; /* 限制页面最大宽度，与图片类似 */
  margin: 0 auto;
  padding: 0 20px;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  line-height: 1.6;
  color: #333;
  text-align: left; /* 页面内容左对齐 */
}

.page-header {
  background-color: #0d47a1; /* 深蓝色背景 */
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -20px -20px 20px -20px; /* 扩展到页面边缘 */
  box-sizing: border-box;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  font-weight: bold;
  font-size: 1.2em;
}

.home-icon {
  width: 24px;
  height: 24px;
  margin-right: 8px;
  /* 根据图片颜色调整，这里移除了 filter: invert(1)，因为新图片可能是彩色 */
}

.meta-info {
  font-size: 0.8em;
  opacity: 0.8;
  /* 保持这里为空 */
}

.hero-section {
  text-align: center;
  margin-bottom: 30px;
}

.hero-section h1 {
  font-size: 2.2em;
  color: #333;
  margin-bottom: 15px;
  line-height: 1.2;
}

.subtitle {
  font-size: 1.1em;
  color: #555;
  margin-bottom: 25px;
  font-weight: bold;
}

.main-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.text-blocks p {
  margin-bottom: 1em;
  font-size: 0.95em;
}

.text-blocks .link {
  color: #0d47a1;
  text-decoration: underline;
}

.qualify-section {
  margin-top: 40px;
  text-align: center; /* 这部分内容居中 */
}

.qualify-section h2 {
  font-size: 1.8em;
  color: #333;
  margin-bottom: 15px;
}

.how-to-steps {
  list-style: none; /* 移除默认列表样式 */
  padding: 0;
  margin: 20px 0;
  text-align: left; /* 步骤文本左对齐 */
  display: inline-block; /* 让列表本身居中 */
}

.how-to-steps li {
  margin-bottom: 10px;
  font-size: 1em;
}

.how-to-steps .link {
  color: #0d47a1;
  text-decoration: underline;
}

.start-select {
  font-weight: bold;
  margin-top: 25px;
  margin-bottom: 15px;
}

.us-map-container {
  margin: 30px auto;
  max-width: 600px;
  border-radius: 8px;
  overflow: hidden; /* 确保内容不溢出 */
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  background-color: #f0f2f5; /* 地图背景色 */
}

.us-map-image-placeholder {
  max-width: 100%;
  height: auto;
  display: block; /* 移除图片底部空白 */
  cursor: pointer; /* NEW: 添加鼠标手型，提示用户图片可点击 */
}

/* 简单的SVG地图样式，如果你嵌入了真实的SVG */
.us-map {
  width: 100%;
  height: auto;
  fill: #5067E6; /* 蓝色 */
  stroke: #ffffff; /* 白色边框 */
  stroke-width: 0.5;
  display: none; /* 默认隐藏SVG，显示图片占位符 */
}

.qualify-button {
  background-color: #4CAF50; /* 绿色按钮 */
  color: white;
  padding: 15px 30px;
  font-size: 1.2em;
  border: none;
  border-radius: 5px;
  cursor: pointer; /* NEW: 添加鼠标手型 */
  margin-top: 30px;
  margin-bottom: 40px;
  display: inline-flex; /* 允许箭头图标 */
  align-items: center;
  gap: 10px;
  transition: background-color 0.3s ease;
}

.qualify-button:hover {
  background-color: #45a049;
}

/* 保持 footer 的 style 注释掉 */
/* .page-footer {
  text-align: center;
  margin-top: 40px;
  padding: 20px;
  border-top: 1px solid #eee;
  font-size: 0.8em;
  color: #777;
}

.page-footer a {
  color: #777;
  text-decoration: none;
  margin: 0 5px;
}

.page-footer a:hover {
  text-decoration: underline;
} */
</style>